

//DOFILE - DISCRIMINATION AND MORAL ASSESSMENT//

use Data_DK

*******************************************
//Tabulate and regress original DV and IV//
*******************************************

codebook Splitgroup2
ta Q9 Splitgroup2
reg Q9 i.Splitgroup2, r

***************************************
//Recode and generate dummy variables//
***************************************

//Acceptance
recode Q9 (1 2 3 4=0) (5 6 7=100), gen(accept)
ta accept
ta accept Splitgroup2

recode Q9 (1 2 3=0) (4 5 6 7=100), gen(noopp)
ta noopp

//Discrimination type
recode Splitgroup2 (1=1 "Taste-based") (4=2 "Inaccurate statistical") (2=3 "Biased statistical") (3=4 "Accurate statistical"), gen(disktype)
codebook disktype


//Experienced disadvantage
codebook Q2
recode Q2 (1=1 "yes") (2=0 "no") (88=.), gen(expdisc)

//Experiences ethnic disadvantage
codebook Q3, tab(100)
recode Q3 (8=1 "etnicitet") (1/7=0 "andet") (9/10=0 "andet"), gen(etndisk)
codebook etndisk

//Decision-making style
foreach var in Q5_1 Q5_2 Q5_3 Q5_4 Q5_5 Q5_6 Q5_7 {
	recode `var' (88=.), gen(`var'con)
}

codebook Q5_*con

foreach var in Q5_1 Q5_2 Q5_3 Q5_4 Q5_5 Q5_6 Q5_7 {
	recode `var' (1/4=0 "Disagree") (5/7=100 "Agree") (88=.), gen(`var'dummy)
}

codebook Q5_*dummy

//Feelings towards citizens with non-Western backgrounds
codebook Q4_8

recode Q4_8 (0/49=0 "cold") (50/100=1 "warm") (998=.), gen(feelingsdummy)
recode Q4_8 (998=.), gen(feelingcon) //codes 'don't know' as missing.

codebook feelingsdummy
codebook feelingcon

*******************************************
//Descriptive statistics//
*******************************************
codebook gender region profile_education profile_age_1 household_income

***********************************
//Main analysis: moral assessment//
***********************************
reg accept i.disktype, r
margins, over(disktype)
marginsplot, scheme(plotplain) title("Moral acceptance") xtitle("Treatment groups") ytitle("Acceptance percentage") recast(bar) plotopts(barwidth(0.5) bcolor(black*0.3)) xoverhangs
graph save i1, replace 

reg accept ib2.disktype, r 

reg noopp i.disktype, r
margins, over(disktype)
marginsplot, scheme(plotplain) title("No moral opposition - DK Sample") xtitle("Treatment groups") ytitle("No opposition percentage") recast(bar) plotopts(barwidth(0.5) bcolor(black*0.3)) xoverhangs
graph save i2, replace

graph combine i1.gph i2.gph, scheme(plotplain)


reg Q9 i.disktype, r //robustness check. Non-recoded DV.
margins, over(disktype)
marginsplot, scheme(plotplain) title("Moral acceptance") xtitle("Treatment groups") ytitle("Acceptance means") recast(bar) plotopts(barwidth(0.5) bcolor(black*0.3)) xoverhangs


**************************************
//Exploratory analyses//
**************************************

//Interactions with feelings towards non-western citizens
reg accept i.disktype##feelingsdummy, r //not significant
reg Q9 i.disktype##feelingsdummy, r //not significant

reg Q9 i.disktype##c.feelingcon, r //Inacc slightly more acceptable the warmer the feelings, compared to taste-based
reg accept i.disktype##c.feelingcon, r //not significant

reg accept i.disktype##i.feelingsdummy, r
margins disktype#feelings
marginsplot, recast(bar) by(feelings) scheme(plotplain) title("Moral assessment across discrimination types - DK Sample") xtitle("Treatment groups") ytitle("Moral acceptance")

reg Q9 i.disktype##i.feelingsdummy, r
margins disktype#feelings
marginsplot, recast(bar) by(feelings) scheme(plotplain) title("Discrimination acceptability - marginal effects") xtitle("Treatment groups") ytitle("Moral acceptance percentage")

//Interaction between disktype and exp discrimination
reg Q9 i.disktype##i.expdisc, r
reg accept ib2.disktype##i.expdisc, r

margins i.disktype#i.expdisc
marginsplot, recast(bar) by(expdisc) scheme(plotplain) title(Experienced discrimination) xtitle(Treatment groups) ytitle(Acceptance percentage) xlabel(1 "Taste" 2 "Inacc." 3 "Biased" 4 "Acc.") note(" ")

//Interaction between disktype and exp ethnic discrimination
reg Q9 i.disktype##i.etndisk, r
margins i.disktype#i.etndisk
marginsplot, recast(bar) by(etndisk) scheme(plotplain) title(Experienced discrimination) xtitle(Treatment groups) ytitle(Acceptance percentage) xlabel(1 "Taste" 2 "Inacc." 3 "Biased" 4 "Acc.") note(" ")


//Interaction with decision-making style
reg accept i.disktype##c.Q5_1con, r
reg accept i.disktype##c.Q5_2con, r
reg accept i.disktype##c.Q5_3con, r
reg accept i.disktype##c.Q5_4con, r
reg accept i.disktype##c.Q5_5con, r
reg accept i.disktype##c.Q5_6con, r
reg accept i.disktype##c.Q5_7con, r

reg Q9 i.disktype##i.Q5_1dummy, r // trust gut feelings all sign.
reg Q9 i.disktype##i.Q5_2dummy, r // Feelings and instincts accurate sign.
reg Q9 i.disktype##i.Q5_3dummy, r // consider all options insign.
reg Q9 i.disktype##i.Q5_4dummy, r // pros and cons insign.
reg Q9 i.disktype##i.Q5_5dummy, r // morally right thing insign.
reg Q9 i.disktype##i.Q5_6dummy, r // Logical and practical insign.
reg Q9 i.disktype##i.Q5_7dummy, r // Other peoples opinion insign.

reg accept i.disktype##i.Q5_1dummy, r // trust gut feelings sign.
reg accept i.disktype##i.Q5_2dummy, r // Feelings and instincts Accurate sign.
reg accept i.disktype##i.Q5_3dummy, r // consider all options insign.
reg accept i.disktype##i.Q5_4dummy, r // pros and cons, biased sign.
reg accept i.disktype##i.Q5_5dummy, r // morally right thing insign.
reg accept i.disktype##i.Q5_6dummy, r // Logical and practical insign.
reg accept i.disktype##i.Q5_7dummy, r // Other peoples opinion acc and inacc sign.

//Interactions with fairness perceptions//
******************************************
foreach var in Q1_1 Q1_2 Q1_3 {
recode `var' (1/4=0 "uenig") (5/7=1 "enig") (88=.), gen(`var'dummy)
}

foreach var in Q1_1 Q1_2 Q1_3 {
recode `var' (88=.), gen(`var'con)
}

codebook Q1_*dummy

reg accept i.disktype##c.Q1_1con, r // Inacc is sign.
reg accept i.disktype##c.Q1_2con, r //Inacc and Accurate is sign.
reg accept i.disktype##c.Q1_3con, r // Biased is significan, the more fair, the more ok.

reg accept i.disktype##i.Q1_1dummy, r // inacc og biased sign.
reg accept i.disktype##i.Q1_2dummy, r // Inacc and acc is sign.
reg accept i.disktype##i.Q1_3dummy, r // biased sign.

reg Q9 i.disktype##i.Q1_1dummy, r // ikke sign.
reg Q9 i.disktype##i.Q1_2dummy, r // inacc og acc. sign.
reg Q9 i.disktype##i.Q1_3dummy, r // biased sign.

reg Q9 i.disktype##c.Q1_1con, r // Inacc sign., mere fair, mere ok.
reg Q9 i.disktype##c.Q1_2con, r // Inacc sign., mere fair, mere ok.
reg Q9 i.disktype##c.Q1_3con, r // Inacc og biased sign. Mere fair, mere OK.

reg accept i.disktype##i.Q1_1dummy, r
margins disktype#Q1_1dummy
marginsplot, recast(bar) by(Q1_1dummy) scheme(plotplain) title("Discrimination acceptability - Educational fairness") xtitle("Treatment groups") ytitle("Moral acceptance percentage")

reg accept i.disktype##i.Q1_2dummy, r
margins disktype#Q1_2dummy
marginsplot, recast(bar) by(Q1_2dummy) scheme(plotplain) title("Discrimination acceptability - Job fairness") xtitle("Treatment groups") ytitle("Moral acceptance percentage")

reg accept i.disktype##i.Q1_3dummy, r
margins disktype#Q1_3dummy
marginsplot, recast(bar) by(Q1_3dummy) scheme(plotplain) title("Discrimination acceptability - Political fairness") xtitle("Treatment groups") ytitle("Moral acceptance percentage")


//MANIPULATION CHECKS AND FILLER CASES//
****************************************
codebook Q12
tab Q12 disktype, column
*67% med taste-based svarer rigtigt
*60% med inacc svarer rigtigt
*23% med acc svarer rigtigt
*47% med biased svarer rigtigt

recode Q12 (2=1 "taste") (3=2 "inacc") (1=3 "biased") (4=4 "acc"), gen(MC)

reg Q9 i.disktype if (disktype==1 & MC==1) | (disktype==2 & MC==2) | (disktype==3 & MC==3) | (disktype==4 & MC==4), r 

margins, over(disktype)
marginsplot, scheme(plotplain) title("Moral acceptance") xtitle("Treatment groups") ytitle("Acceptance means") recast(bar) plotopts(barwidth(0.5) bcolor(black*0.3)) xoverhangs
//Excludes all respondents that failed the manipulation check - the results are robust but accurate is much more acceptable. probably driven by fewer respondents who would actually accept the statistics.


codebook disktype if (Splitgroup1==1 & Q6>4) | (Splitgroup1==2 & Q6<4)
tab Q6 Splitgroup1
reg Q9 i.disktype if (Splitgroup1==1 & Q6>4) | (Splitgroup1==2 & Q6<4), r

margins, over(disktype)
marginsplot, scheme(plotplain) title("Moral acceptance") xtitle("Treatment groups") ytitle("Acceptance means") recast(bar) plotopts(barwidth(0.5) bcolor(black*0.3)) xoverhangs
reg accept i.disktype, r
// Excludes those that failed the filler case. Effects robust.
